var pageParamStr = $.url().param('pageParam');
var pageParam = JSON.parse(pageParamStr);

var paperRecord = {
	paperId: '',
	staffId: pageParam.staffId,
	paperType: pageParam.paperType,
	paperNum: pageParam.paperNum,
	batchNum: pageParam.batchNum,
	startNum: pageParam.startNum,
	endNum: pageParam.endNum,
	status: 0,
	amount: pageParam.amount,
	createId: pageParam.staffId,
	updateId: pageParam.staffId,
	createTime: '',
	updateTime: '',
	relationId: pageParam.relationId,
	beHospitalId: pageParam.beHospitalId,
    pledge:pageParam.pledge,
    totalFee:pageParam.totalFee,
    totalPay:pageParam.totalPay
};

var view = {
	data: paperRecord
};

var vue_vm = new Vue({
	el: '#vue_vm',
	data: view,
	methods: {
		getTitle:function() {
			var paperTypeName = '';
			
			switch(parseInt(pageParam.paperType)) {
				case 1:
					paperTypeName = '发票';
					break;
				case 2:
					paperTypeName = '预交款收据';
					break;
				case 3:
					paperTypeName = '收费凭据';
					break;
				case 4:
					paperTypeName = '退费';
					break;
			}
			
			var title = '用户姓名：' + pageParam.staffName + ' 票据类型：' + paperTypeName;
			return title;
		}
	}
});

function save() {
	save_basic(path+'/paperRecord/save', {paperRecord:view.data}, function() {
		$('#printResult').text('打印成功！');
	});
}

save();